/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.great.functionalCore;

import br.great.config.FacebookData;
import java.io.IOException;
import java.io.PrintStream;
import java.net.MalformedURLException;

//Essa classe contém um método que copia os dados do Facebook capturados da intenet
//em uma lista de FacebookProfileString pelos métodos de um objeto ObtainsFriendInference
//para os arquivos txt criados na classe FacebookData.
public class SaveFacebookInstances {

	public void saveFacebookInstances(ObtainsFriendInference obf, String nome) throws MalformedURLException, IOException {
		obf.generateFacebookProfile(nome);
		PrintStream name = FacebookData.writeFacebookName(nome);
		PrintStream bluetooth = FacebookData.writeFacebookBluetooth(nome);
		PrintStream birthday = FacebookData.writeFacebookBirthday(nome);
		for (int i = 0; i < obf.vtFacebookProfile.size(); i++) {
			name.println(obf.vtFacebookProfile.get(i).getName());
			bluetooth.println(obf.vtFacebookProfile.get(i).getBluetooth());
			birthday.println(obf.vtFacebookProfile.get(i).getBirthday());
		}
		name.close();
		bluetooth.close();
		birthday.close();

	}
}
